package org.helgoboss.scala_commandlet

import org.helgoboss.commandlet.ExecutionContext
import org.helgoboss.commandlet_osgi.OsgiCommandlet
import org.specs.util.ScalaInterpreter
import java.io.PrintWriter

class ScalaCommandlet extends OsgiCommandlet {
	val id = "org.helgoboss.scala"
    
	def execute(context: ExecutionContext) = {
        val result = ScalaInterpreter.interpret("""println("hallo")""")
        val writer = new PrintWriter(context.outputStream, true)
        writer.println(result)
        Thread.sleep(500)
        0
	}
}